package com.example.ppjoke.splash;

import android.view.View;

import androidx.lifecycle.Observer;
import androidx.viewbinding.ViewBinding;

import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ToastUtils;
import com.example.common.mvvm.view.BaseActivity;
import com.example.ppjoke.databinding.ActivitySplashBinding;

public class SplashActivity  extends BaseActivity<ActivitySplashBinding,SplashViewModel> {
    @Override
    public View bindLayout() {
        return v.getRoot();
    }

    @Override
    public ViewBinding initBinding() {
        ActivitySplashBinding binding = ActivitySplashBinding.inflate(inflater);
        return binding;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        vm.dataBus.observe(this, new Observer<String>() {
            @Override
            public void onChanged(String s) {
                v.splashTimeTv.setText(s);
                if (s.equals("0s")){
                    finish();
                    ARouter.getInstance().build("/app/DynamicActivity").navigation();
//                    ARouter.getInstance().build("/aaa/BasicActivity").navigation();
                }
            }
        });
    }
}
